package com.passbook.merchant.util;


import com.auth0.jwt.JWT;
import com.auth0.jwt.algorithms.Algorithm;
import com.passbook.common.constant.Constants;
import com.passbook.merchant.vo.PassTemplateVO;

import java.io.UnsupportedEncodingException;

public class JWTUtil {

    private static final String TOKEN_PREFIX = "Bearer ";

    public static String genToken(String merchantId) throws UnsupportedEncodingException {
//        Long merchantId = passTemplateVO.getId();
        String token = "";
        token = TOKEN_PREFIX + JWT.create().withAudience(merchantId).sign(Algorithm.HMAC256(Constants.TOKEN_STRING));
        return token;
    }
}
